﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Test
{
    /// <summary>
    ///     放一些测试用的类
    /// </summary>
    public static class Common
    {

        /// <summary>
        ///     用于判断两个数组是否相等
        /// </summary>
        /// <typeparam name="T">类型</typeparam>
        /// <param name="t1">数组1</param>
        /// <param name="t2">数组2</param>
        /// <returns></returns>
        public static bool CheckArraySame<T>(T[] t1, T[] t2)
        {
            if (t1.Length != t2.Length)
                return false;
            for (int i = 0; i < t1.Length; i++)
            {
                if (!Object.Equals(t1[i], t2[i]))
                {
                    return false;
                }
            }
            return true;
        }

        /// <summary>
        ///     判断两个List是否相等
        /// </summary>
        /// <typeparam name="T">类型</typeparam>
        /// <param name="t1">List1</param>
        /// <param name="t2">List2</param>
        /// <returns></returns>
        public static bool CheckListSame<T>(List<T> t1, List<T> t2)
        {
            if (t1.Count != t2.Count)
                return false;
            for (int i = 0; i < t1.Count; i++)
            {
                if (!Object.Equals(t1[i], t2[i]))
                {
                    return false;
                }
            }
            return true;
        }

    }
}
